﻿using System.ComponentModel;
using System.Windows;
using Autofac;
using Play.AudioEngine;
using Play.Shell.Views;
using Play.TrackManagement;
using Play.VstPluginManagement;

namespace Play
{
	public partial class App
	{
		private TrackSession _trackSession;
		private VstPluginCatalog _vstPluginCatalog;
		private PortAudioVstPlayback _audioPlayback;

		private void App_OnStartup(object sender, StartupEventArgs e)
		{
			var containerConfiguration = new ContainerConfiguration();
			Boot(containerConfiguration.Container);
		}

		private void Boot(IComponentContext scope)
		{
			_audioPlayback = scope.Resolve<PortAudioVstPlayback>();
			_trackSession = scope.Resolve<TrackSession>();
			_vstPluginCatalog = scope.Resolve<VstPluginCatalog>();

			MainWindow = scope.Resolve<MainWindow>();
			MainWindow.Show();
		}
	}
}
